package com.daily.DailyStudy.常用工具类;

import org.springframework.boot.system.ApplicationHome;

import java.io.File;

public class 获取j打包后ar包地址 {

    ApplicationHome applicationHome = new ApplicationHome();

    String name = "windows";

    void getURL(String getFileName){
        File jarFile =  applicationHome.getSource();
        File parFile = jarFile.getParentFile();
        String path;
        if ("linux".equalsIgnoreCase(name)) {
            path = parFile + "/config/" + getFileName;
        } else {
            path = parFile + "\\config\\" + getFileName;
        }
        File file = new File(path);
        boolean exists = file.exists();
        if (!exists) {
            //创建文件

        }
    }
}
